﻿using DapperExtensions;
using DapperExtensions.Mapper;
using DapperExtensions.Sql;
using WMLogistics.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Dapper;

namespace WMLogistics_Dao
{
    public class WuliuFeeDao
    {
        private SqlGeneratorImpl sqlGenerator;
        public WuliuFeeDao()
        {
            var config = new DapperExtensionsConfiguration(typeof(AutoClassMapper<>), new List<Assembly>(), new MySqlDialect());
            sqlGenerator = new SqlGeneratorImpl(config);
            DapperExtensions.DapperExtensions.Configure(config);
        }

        public wuliu_wlcompany_fee GetByWuliuNo(string wuliu_no)
        {
            var sql = "select * from wuliu_wlcompany_fee  where and fee_state=10 wuliu_no=@wuliu_no";

            using (var conn = ConnectionHelper.OpenConnection())
            {
                return conn.Query<wuliu_wlcompany_fee>(sql, wuliu_no).ToList().FirstOrDefault();
            }
        }
    }
}
